<script setup>
import { useRouter } from 'vue-router'

const router = useRouter();
let fun = (id, language) => {
  router.push({path: `/detail`, query:{id:id, language:language}});
  // router.push('/detail?id=2&language=Python');
}

</script>

<template>
  <div>
    <router-link to="/detail/1/Java">声明式路由路径传参跳转详情组件</router-link>
    <input type="button" @click="fun(2, 'Python')" value="编程式路由键值对传参跳转详情组件" />
    <hr>
    <router-view></router-view>
    
  </div>
  
</template>

<style scoped>
</style>
